package com.thinkcoder.service;

import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author : 商俊帅
 * @Date : 2021/4/5 16:43
 * @Description :
 */
@Component
public class DefaultCredentialStorage implements CredentialStorage{
    private static final Map<String, String> map = new HashMap<>();

    // mock appKey and password relations
    static {
        map.put("order", "order123");
        map.put("pay", "pay123");
        map.put("goods", "goods123");
        map.put("user", "user123");
    }

    @Override
    public String getPasswordByAppKey(String appKey) {
        return map.get(appKey);
    }
}
